import { _decorator, Component, Button, director, log } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('LoginManager')
export class LoginManager extends Component {
    @property(Button)
    loginButton: Button = null; // 登录按钮

    start() {
        log('LoginManager 已启动');
        if (this.loginButton) {
            log('登录按钮已绑定');
            this.loginButton.node.on(Button.EventType.CLICK, this.onLogin, this);
        } else {
            log('登录按钮未绑定');
        }
    }

    // 登录逻辑
    onLogin() {
        log('点击登录按钮');
        director.loadScene('GameScene'); // 跳转到游戏场景
    }
} 